<!doctype HTML>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<body id="anchor" contenteditable>
<table border="1" ><tr><td>This should be selected.</td></tr><tr><td>This should be selected.</td></tr></table>
<hr>
<p id="focus">foo bar</p>
<div id="log"></div>
<script>
test(function() {
    document.execCommand('selectAll');

    var selection = window.getSelection();
    var anchor = document.getElementById('anchor');
    var focus = document.getElementById('focus').firstChild;
    assert_equals(selection.anchorNode, anchor, 'anchorNode');
    assert_equals(selection.anchorOffset, 1, 'anchorOffset');
    assert_equals(selection.focusNode, focus, 'focusNode');
    assert_equals(selection.focusOffset, 7, 'focusOffset');
});
</script>
